import request from "../../api/home";
export default {
	state: {
		todayData: {
			attendCount: "",
			activityIncome: "",
			courseIncome: "",
			orderNum: "",
		},
		moneyData: {},
	},
	mutations: {
		setTodayData(state, val) {
			state.todayData = val;
		},
		setMoneyData(state, val) {
			state.moneyData = val;
		},
	},
	actions: {
		getTodayData(context, value) {
			request.getTodayData().then((res) => {
				if (res.code == 200 && res.success == 0) {
					context.commit("setTodayData", res.data);
				}
			});
		},
		getMoneyData(context, value) {
			request.getMoneyData().then((res) => {
				if (res.code == 200 && res.success == 0) {
					context.commit("setMoneyData", res.data);
				}
			});
		},
	},
	getters: {
		// getData123(state) {
		// 	return state.moneyData;
		// },
	},
	namespaced: true,
};
